<?php

function get_middle_name_by_id($middle_id){
	$middle_name = M('middle_level')->where(array('id'=>$middle_id))->getField('middle_name');
	return $middle_name;
}
/** 
* getImg  
* 获取某个模块下的图片及条数
* 
* @access public 
* @param mixed $model 模块名称 
* @param mixed $rows 读取条数  
* @return array 
*/  
		function getImg($model='',$rows='')
		{
			if($model == ''){
				return false;
			}
			$model = M($model);
			if($rows!=''){
				$datalists = $model->where('is_display=1')->limit($rows)->field('pic')->select();
			}else{
				$datalists = $model->where('is_display=1')->field('pic')->select(); 
			}
			return $datalists;
		}
